#include "StdAfx.h"
#include "BinTreeTest.h"


BinTreeTest::BinTreeTest(void)
{
}


BinTreeTest::~BinTreeTest(void)
{
}

TEST_F(BinTreeTest, prePrint)
{
	prePrint( pRoot );
	SUCCEED() << "Check yourself";
}

TEST_F(BinTreeTest, prePrint_iter)
{
	prePrint_iter( pRoot );
	SUCCEED() << "Check yourself";
}

TEST_F(BinTreeTest, postPrint)
{
	postPrint(pRoot);
	
	SUCCEED(); 
}

TEST_F(BinTreeTest, inPrint)
{
	inPrint( pRoot );
	SUCCEED(); 
}

TEST_F(BinTreeTest, inPrint_iter)
{
	inPrint_iter( pRoot );
	SUCCEED(); 
}

TEST_F(BinTreeTest, rebuild)
{
	int preArr[] = {80, 0, 2, 4, 5, 3, 1};
	int inArr[] = {4,2,5,0,3,80,1};

	binTreeNode* pMyRoot = new binTreeNode();
	rebuild(preArr, inArr, 7, pMyRoot);

	postPrint(pMyRoot);
}

TEST_F(BinTreeTest, node_and_leave)
{
	int node = 0, leave = 0;
	num_node_leave(pRoot, node, leave);
	cout << "node=" << node <<" leave=" << leave << endl;

}